<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<!--开启thymeleaf标签库-->
<head>
<title>Reading List</title>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" th:href="@{/style.css}" />
</head>
<body>
	<h2>Your Reading List</h2>
	<div th:unless="${#lists.isEmpty(books)}">
		<dl th:each="book : ${books}">
			<dt class="bookHeadline">
				<a th:href="'http://www.amazon.com/gp/product' + ${book.isbn} + '/tag=' + ${amazonID}"
					th:text="${book.title}" target="_Blank"></a>
				<span th:text="${book.title}">Title</span> by 
				<span th:text="${book.author}">Author</span> 
				(ISBN: <span th:text="${book.isbn}">ISBN</span>)
			</dt>
			<dd class="bookDescription">
				<span th:if="${book.description}" th:text="${book.description}">Description </span> 
				<span th:if="${book.description eq null}"> No description available </span>
			</dd>
		</dl>
	</div>
	<div th:if="${#lists.isEmpty(books)}">
		<p>You have no books in your book list</p>
	</div>

	<hr />

	<h3>Add a book</h3>
	<form method="POST" action="/">
		<label for="title">Title:</label> 
		<input type="text" name="title" size="50" /><br /> 
		<label for="author">Author:</label> 
		<input type="text" name="author" size="50" /><br /> 
		<label for="isbn">ISBN:</label>	
		<input type="text" name="isbn" size="15" /><br /> 
		<label for="description">Description:</label> 
		<textarea name="description" cols="80" rows="5"></textarea><br />
		<input type="submit" />
	</form>
</body>
</html>